﻿using MoviesRoom.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Web;

namespace MoviesRoom.Areas.Administration.ViewModels
{
    public class VotesViewModel
    {
        public static Expression<Func<Vote, VotesViewModel>> FromVotes
        {
            get
            {
                return t => new VotesViewModel()
                {
                    Id = t.Id,
                    FilmName = t.Film.Title,
                    UserName = t.User.UserName,
                    Value = t.Value
                };
            }
        }

        [ScaffoldColumn(false)]
        public int Id { get; set; }

        public string FilmName { get; set; }

        public string UserName { get; set; }

        public double Value { get; set; }
    }
}